import {defineStore} from "pinia";
import {computed, ref} from "vue";

//store风格1：Setup Store
export const useUserStore = defineStore('user', () => {
    //state 属性
    const count = ref(0);
    //getters
    const doubleCount=computed(() => {
        return count.value*2;
    })
    //actions
    function increment() {
        count.value++;
    }

    return {count,doubleCount, increment};
})